package com.cloud.quickcore.admin.entity;

import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * 角色--资源表
 *
 * @author NiJo_H
 * @version 1.0
 * @date 2019/8/14 16:28
 */
@Entity
@Table(name = "sys_role_permission")
@Data
public class SysRolePermission {
    @Id
    @SequenceGenerator(name = "seq_rp", sequenceName = "seq_rp", allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_rp")
    @Column(name = "id")
    private Long id;

    /**
     * 角色Id
     */
    @Column(name = "role_id")
    private Long roleId;

    /**
     * 资源Id
     */
    @Column(name = "permission_id")
    private Long permissionId;

    /**
     * 创建时间
     */
    @CreationTimestamp
    @Column(name = "create_at")
    private LocalDateTime createAt;

    /*更新时间*/
    @UpdateTimestamp
    @Column(name = "update_at")
    private LocalDateTime updateAt;
}
